<template>
    <div>
        <el-table :data="data" border stripe>
            <el-table-column 
            :label="item.title"
            :prop="item.name"
            :type="item.type"
            :width="item.width"
          
            v-for="item,i in cols"
            :key="i"
            >
            <template v-if="item.slot" v-slot="{row}">
                <slot :name="item.slot" :row="row"></slot>
            </template>
            <template v-if="item.slot" v-slot="{row}">
                <slot :name="item.slot" :row="row"></slot>
            </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
export default {
    props: {
        data: {
            required: true,
            type: Array,
            default: () => []
        },
        cols: {
            required: true,
            type: Array,
            default: () => []
        }
    },
    data() {
        return {

        }
    },
    methods: {

    },
    created() {

    },
    mounted() {

    },
    components: {

    },
    computed: {

    },
    watch: {

    },
}
</script>

<style lang='scss' scoped></style>
